Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement the ABI lookup support by enhancing the MoveStructType inte… #631

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

VolodymyrBg
Copy link

…rface

I've implemented the ABI lookup support by enhancing the MoveStructType interface. Here's what I added:
type: The fully qualified name of the struct in the Move format (address::module::name)
fields: A map of field names to their Move types, allowing for dynamic lookup of struct fields
genericTypeParams: Optional array of generic type parameters if the struct is generic
abilities: Optional array of Move abilities that the struct has
This implementation allows for proper typing of Move structs and enables:
Type checking of struct fields
Support for generic structs
Ability to verify struct capabilities
Dynamic field lookup from ABI

@VolodymyrBg VolodymyrBg requested a review from a team as a code owner February 7, 2025 19:59
gregnazario
gregnazario previously approved these changes Feb 10, 2025
Copy link
Collaborator

@gregnazario gregnazario left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good to add a test for it

@gregnazario gregnazario self-requested a review February 10, 2025 18:41
@gregnazario gregnazario dismissed their stale review February 10, 2025 18:41

Let's see with the updates

- Add proper typing for Move struct fields and their types
- Support generic type parameters and abilities
- Add comprehensive test suite for struct type validation
- Improve type safety for Move struct handling
@VolodymyrBg
Copy link
Author

@gregnazario Added test

@gregnazario
Copy link
Collaborator

Looks like there's some typing issues. Can you run the lints npm lint and npm build and see how to fix it?

@VolodymyrBg
Copy link
Author

Looks like there's some typing issues. Can you run the lints npm lint and npm build and see how to fix it?

working on it

@VolodymyrBg
Copy link
Author

@gregnazario Done.

@VolodymyrBg
Copy link
Author

@gregnazario
I hope now it's going to work properly.. sorry for taking your time

@VolodymyrBg
Copy link
Author

Last attempt))
@gregnazario

@VolodymyrBg
Copy link
Author

Never give up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants